<?php
/**
 * 餐厅合并页面
 *
 * @copyright shaocong
 * @since 2012-06-05
 */
include_once($_SERVER["DOCUMENT_ROOT"] . "/core/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/core/admin.inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/include/foodv2/inc.php");

//所有的参数
$g_cgival 	= array();
//存储中间数据 非输出数据 可以不用
$g_pro	 	= array();
//要显示的数据 输出数据
$g_show 	= array();

function check_cgi_pro()
{	
	global $g_cgival, $g_pro, $g_show;
	cgi::get($g_cgival["id"], "id", "");
		
}


function get_data()
{
	global $g_cgival, $g_pro, $g_show, $config;
	$g_show['RstrtID'] = $g_cgival['id'];	
	
	$myobj = new mod_web_rstrt();	
	$args[] = "RstrtID in({$g_cgival['id']})";
	$rstrtData = $myobj->admin_get_rstrt_list(-1,-1,$args,'RstrtID desc');
	$g_show['data_list']=$rstrtData;	
}

try
{
	admin_check_login();
// 	admin_check_user_priv("eat/rstrt_merge.php");
	check_cgi_pro();
	get_data();
	show_pro();
}
catch(Exception $e)
{
	echo $e->getMessage();
	exit;
}

exit;

function show_pro()
{
	global $g_cgival, $g_pro, $g_show, $config;

	if (isset($g_show['error'])) {
		die($g_show['errmsg']);
	} else {

		$smarty = p_get_smarty();
		$smarty->assign ( 'g_show', $g_show );

		$smarty->display("foodv2/rstrt/rstrt_merge.html");
	}
	
	unset($g_cgival);
	unset($g_pro);
	unset($g_show);
	unset($config);
}

?>